# SPDX-FileCopyrightText: 2023-2025 Sangfor Technologies Inc.
# SPDX-License-Identifier: Mulan PSL v2
#!/bin/bash

count_lines() {
    local path=$1
    local extensions=$2
    local total_lines=0

    for file in $(find "$path" -type f -name "*.$extensions"); do
        lines=$(wc -l < "$file")
        total_lines=$((total_lines + lines))
    done

    echo "Total lines of code: $total_lines"
}

extensions="py|java|cpp|h|c"
count_lines `pwd` "$extensions"
